<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" type="text/css" href="">
    <link rel="stylesheet" type="text/css" href="">
    <script type="text/javascript" src="../resources/fw/fwCommon2.js"></script>
    <script type="text/javascript">
        var xmlhttp;
        function createxmlHttp() {
            //创建xmlhttp对象
            if (window.XMLHttpRequest)
                xmlhttp = new XMLHttpRequest();
            else
                xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
        }

        function createRequest() {
            createxmlHttp();
            var data={fw_service: "commService", fw_method: "login", fw_mapperid: "", fw_param: {}};
          //  var url="http://localhost:8080/hello/fw/doService.do?fw_service=commService&fw_method=login&t="+ Math.random();
            var url="http://localhost:8080/hello/fw/doService.do?fw_service=commService&fw_method=login";
            xmlhttp.onreadystatechange = callbacksuccess    //回调函数
            xmlhttp.open('post', url, true);     //发送ajax
            xmlhttp.setRequestHeader("Content-type", "application/json;charset=UTF-8");
            xmlhttp.send(JSON.stringify(data));  //get时data为null
        }

        function callbacksuccess() {
            if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
                // 成功后执行的代码
                alert(xmlhttp.readyState+","+xmlhttp.status);
            }
        }
        createRequest();
    </script>
</head>
<body>
<h2>上传多个文件 实例</h2>

<a href="#" onclick="createRequest()">test</a>
</body>
</html>